---
title: Linter Installation
description: Installing the bloc linter.
sidebar:
  order: 2
---

import { CardGrid } from '@astrojs/starlight/components';
import Card from '~/components/landing/Card.astro';
import InstallBlocToolsSnippet from '~/components/lint/InstallBlocToolsSnippet.astro';
import BlocToolsLintHelpOutputSnippet from '~/components/lint/BlocToolsLintHelpOutputSnippet.astro';
import InstallBlocLintSnippet from '~/components/lint/InstallBlocLintSnippet.astro';
import BlocLintRecommendedAnalysisOptionsSnippet from '~/components/lint/BlocLintRecommendedAnalysisOptionsSnippet.astro';
import BlocLintMultipleRecommendedAnalysisOptionsSnippet from '~/components/lint/BlocLintMultipleRecommendedAnalysisOptionsSnippet.astro';

## Command-Line Tools

To use the linter from the command line, install
[`package:bloc_tools`](https://pub.dev/packages/bloc_tools) via the following
command:

<InstallBlocToolsSnippet />

Once the bloc command-line tools have been installed, you can run the bloc
linter via the `bloc lint` command:

<BlocToolsLintHelpOutputSnippet />

## Recommended Rule Set

To install the recommended lint rule set, install
[`package:bloc_lint`](https://pub.dev/packages/bloc_lint) as a dev dependency
via the following command:

<InstallBlocLintSnippet />

Then, add an `analysis_options.yaml` to the root of your project with the
recommended rule set:

<BlocLintRecommendedAnalysisOptionsSnippet />

If needed, you can include multiple rule sets by defining them as a list:

<BlocLintMultipleRecommendedAnalysisOptionsSnippet />

## IDE Integrations

The following IDEs officially support the bloc linter and language server to
provide instant diagnostics directly within your IDE.

<CardGrid>
	<Card title="VSCode" icon="vscode">
		Support for the [Bloc VSCode
		Extension](https://marketplace.visualstudio.com/items?itemName=FelixAngelov.bloc)
		is available in v6.8.0.
	</Card>
	<Card title="IntelliJ" icon="jetbrains">
		Support for the [Bloc IntelliJ
		Plugin](https://plugins.jetbrains.com/plugin/12129-bloc) is available in
		v4.1.0.
	</Card>
</CardGrid>
